home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1997 January: Mac OS SDK / Dev.CD Jan 97 SDK2.toast / Development Kits (Disc 2) / OpenDoc Development Framework / ODFDev / ODF / Found / FWStream / FWRanSin.h < prev    next >
Encoding:
Text File  |  1996-09-17  |  2.1 KB  |  67 lines  |  [TEXT/MPS ]

  1. //========================================================================================
  2. //
  3. //    File:                FWRanSin.h
  4. //    Release Version:    $ ODF 2 $
  5. //
  6. //    Copyright:    (c) 1993 - 1996 by Apple Computer, Inc., all rights reserved.
  7. //
  8. //========================================================================================
  9.  
  10. #ifndef FWRANSIN_H
  11. #define FWRANSIN_H
  12.  
  13. #include "SLRanSin.xh"
  14.  
  15. #ifndef FWSOMPTR_H
  16. #include "FWSOMPtr.h"
  17. #endif
  18.  
  19. //========================================================================================
  20. //    CLASS FW_PRandomAccessSink
  21. //    This class is a base class for the FW_P…Sink classes.  We avoid the replication 
  22. //    of code for all the FW_TSOMPtr<FW_O…Sink> classes, which are almost all the same.
  23. //
  24. //        Inherited API for operator->()
  25. //            long GetReadableBytes();
  26. //            void Read(in void * destination, in long count);
  27. //            long GetWritableBytes();
  28. //            void Write(in void* source, in long count);
  29. //
  30. //        New API for operator->()
  31. //            long GetLength();
  32. //            void SetLength(in long length);
  33. //            long GetPosition();
  34. //            void SetPosition(in long position);
  35. //
  36. //========================================================================================
  37.  
  38. class FW_PRandomAccessSink : public FW_TSOMPtr<FW_ORandomAccessSink>
  39. {
  40. protected:
  41.     FW_PRandomAccessSink();
  42.     FW_PRandomAccessSink(Environment* ev, FW_ORandomAccessSink* theSink);
  43.  
  44.     virtual ~FW_PRandomAccessSink();
  45.  
  46. private:
  47.     FW_PRandomAccessSink(const FW_PRandomAccessSink&);
  48.     FW_PRandomAccessSink& operator=(const FW_PRandomAccessSink&);
  49. };
  50.  
  51. //----------------------------------------------------------------------------------------
  52. //    FW_PRandomAccessSink::FW_PRandomAccessSink
  53. //----------------------------------------------------------------------------------------
  54. inline FW_PRandomAccessSink::FW_PRandomAccessSink()
  55. {
  56. }
  57.  
  58. //----------------------------------------------------------------------------------------
  59. //    FW_PRandomAccessSink::FW_PRandomAccessSink
  60. //----------------------------------------------------------------------------------------
  61. inline FW_PRandomAccessSink::FW_PRandomAccessSink(Environment* ev, FW_ORandomAccessSink* theSink) :
  62.     FW_TSOMPtr<FW_ORandomAccessSink>(ev, theSink)
  63. {
  64. }
  65.  
  66. #endif
  67.